export type DefFlowModel = {
  id: string;
  flowName: string;
  flowKey: string;
  flowIcon?: string;
  icon: {
    name: string;
    bgc: string;
    color: string;
  };
  flowDef: string;
  flowDefJson?: object;
  formId: string;
  formName: string;
  status: string;
  version: number;
  sort: number;
  groupId: string;
  remark: string;
};

export type FlowModelNode = {
  code: string;
  name: string;
  type: string;
  branch?: any[];
  props: {
    conditionType?: string;
    groupType?: string;
    type?: string;
    mode?: string;
    carbonCopy: string;
    carbonCopyList?: any[];
    formMode: string;
    timeout?: number;
    sort: number;
    isAutoAudit?: string;
    subDefFlowId?: string;
    rejectType?: string;
    isPassSame?: string;
    approveMethod?: string;
    tasks: FlowModelNodeTask[];
    branch?: any[];
    groups?: any[];
    listeners: any[];
    formItemList?: any[];
  };
};

export type FlowModelNodeTask = {
  id?: string;
  type: string;
  code: string;
  name: string;
  jobType: string;
  userId: string;
  roleId: string;
  userList?: any[];
  roleList?: any[];
  dynamicUserType: string;
  dynamicUserId: string;
  dynamicUserName: string;
  dynamicUserLeaderLevel: number;
  dynamicDeptId: string;
  dynamicDeptName: string;
  dynamicUserKey: string;
  dynamicEmptyMethod: string;
  timeout: number;
  sort: number;
};

export type FlowAttrRef = {
  validate: Promise<any>;
};
